/**
 * 测试
 */
'use strict';
angular.module("test",['ngRoute'])
    .config(['$routeProvider', function($routeProvider) {
        $routeProvider.when('/test', {
            templateUrl: 'view3/test.html',
            controller: 'TestController'
        });
    }])
    .controller("TestController",['$scope', '$rootScope', '$location','$http','ConstantBox','ProframeService', testControllerFun]);

function testControllerFun($scope, $rootScope, $location,$http,ConstantBox,ProframeService) {
    var test = this;

    /**
     * get请求demo
     * */
     ProframeService.jsonpRequest('GET','/hello/getword','').then(
        function(data){
            test.users = data.users;
        }
    );

    ProframeService.jsonpRequest('GET','/sysuser/getuser','').then(
        function(data){
            test.dbusers = data.users;
        }
    );
    /**
     * post请求demo
     * */
    var postParam = {
        "name":'liyaohua',
        "age":'123'
    }
    var data = ProframeService.jsonpRequest('POST','/hello/form',postParam).then(
        function(data){
            console.log(data);
        }
    );

}
